import request from '@/utils/request'

/**
 * 获取企业的部门列表
 * @returns
 */
export function getDepartment() {
  return request({
    url: '/company/department'
  })
}

/**
 * 删除 企业的部门列表
 * @returns
 */
export function delDpartment(id) {
  return request({
    url: '/company/department/' + id,
    method: 'DELETE'
  })
}
/**
 * 添加部门
 * @param {*} data
 * @returns
 */
export function addpartment(data) {
  return request({
    url: '/company/department/',
    method: 'POST',
    data
  })
}

/**
 *  获取部门列表
 * @param {*} id  部门id
 * @returns
 */
export function getpartment(id) {
  return request({
    url: '/company/department/' + id
  })
}

/**
 * 根据ID修改部门详情
 * @param {*} data   部门ID
 * @returns
 */
export function editDepartment(data) {
  return request({
    url: '/company/department/' + data.id,
    method: 'PUT',
    data
  })
}
